package com.azzcs.ttl.listener;

import com.azzcs.ttl.service.OrderService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;

/**
 * @Author: wzg
 * @Date: 2021/4/12 下午5:41
 */
@Component
public class OrderListener {
    @Autowired
    private OrderService orderService;

    @RabbitListener(queues = "queue.order.dlx")
    public void handle(String orderId) throws IOException {
        orderService.cancelOrder(orderId);
    }
}
